package uk.me.dewi.validation;

import java.util.HashMap;
import java.util.Set;

public class ValidationException extends RuntimeException {
    private static final long serialVersionUID = 1L;
    
    private HashMap<String, String> problems;

    public ValidationException() {
        super();
    }

    public ValidationException(String detailMessage, HashMap<String, String> problems) {
        super(detailMessage);
        this.problems = problems;
    }

    public ValidationException(String detailMessage) {
        super(detailMessage);
    }

    public String getProblem(String field){
        return problems.get(field);
    }
    
    public Set<String> getFields(){
        return problems.keySet();
    }
}
